import pytest, time
from selenium.webdriver.common.by import By


class ProductEniLocator:
    """
        User ENI 页面
    """
    # 首页提示弹框返回按钮
    product_cancel_button = (By.XPATH, '/html/body/div[3]/div/div[2]/div/div[2]/div/div/div[2]/button[1]/span')
    # 首页My Resources菜单标题//*[@id="root"]/section/div/div/div[1]
    product_my_resources_tittle = (By.XPATH, '(//*[@class="cre-bs-title-subtitle-small"])[4]')
    # 首页菜单按钮//*[@id="root"]/section/div/div/div[1]
    product_menu_button = (By.XPATH, '//*[@id="root"]/section/div/div/div[1]')
    # 菜单页面
    product_menu_page = (By.XPATH, '//*[@id="root"]/section/div/div/div[2]/div[2]/div/div/div[2]/div/div/div[2]/div')
    # ECS菜单按钮
    ecs_menu_button = (By.XPATH, '//*[@class="GlobalDrawer___3Ex2D"]/div/div/div[5]/div[1]/div[3]')
    # iframe
    into_iframe = (By.CSS_SELECTOR, '[id="hj_container"]')
    # ecs的控制台页面标题
    ecs_overview_title = (By.XPATH, '//*[@id="teamix-container"]/div[2]/div[1]/div[1]/div')
    # ENI标题入口按钮
    eni_title_btn = (By.XPATH, '//*[@id="133"]/span/span')
    # ENI页面标题
    eni_page_title = (By.XPATH, '//*[@id="icestarkNode"]/main/section[2]/section[1]/header/section/section[1]/section[1]/span')
    # ENI页面的Create ENI按钮
    create_eni_btn = (By.CSS_SELECTOR, '[data-teamix-spm="ecs.table.networks-mainAction-__teamix_pro_action_key_0"]')
    # Create ENI页面
    create_eni_page = (By.XPATH, '//*[@class="next-loading-wrap"]/div/div/form/div')
    # Create ENI页面ENI name 输入框
    create_eni_name_input = (By.CSS_SELECTOR, '[id="NetworkInterfaceName"]')
    # Create ENI页面Submit按钮
    create_eni_submit_btn = (By.XPATH, '//*[@id="icestarkNode"]/div/div/div/div/div[2]/div/div[2]/button/span')
    # Create ENI提交创建成功提示语Operation succeeded
    create_eni_successful_tips = (By.XPATH, '//*[@class="next-dialog-body"]/div/div/div[2]/div[1]')
    # Create ENI提交创建成功提示语弹框OK按钮
    create_eni_tips_ok_btn = (By.XPATH, '//*[@class="next-dialog-footer next-align-right"]/button')
    # Create ENI控制台页面
    create_eni_console_page = (By.CSS_SELECTOR, '[class="next-table-inner"]')
    # Create ENI提交创建成功的 ENI名称
    create_eni_name = (By.XPATH, '//*[@class="next-table-row first"]/td[2]/div/div/div/div/div/div[2]/div/span/span')

    # ENI列表中的modify按钮
    eni_modify_btn = (By.XPATH, '//*[@class="next-table-row first"]/td[14]/div/div/button[1]/span')
    # ENI modify修改名称的弹框输入框
    eni_modify_name_input = (By.XPATH, '//*[@class="next-loading-wrap"]/div/form/div[1]/div[2]/div/div/div/span/input')
    # ENI modify修改名称的弹框OK按钮
    eni_modify_ok_btn = (By.CSS_SELECTOR, '[class="next-btn next-medium next-btn-primary next-dialog-btn"]')
    # ENI modify修改名称的弹框cancel按钮
    eni_modify_cancel_btn = (By.XPATH, '//*[@class="next-dialog-footer next-align-right next-dialog-footer-has-shadow"]/button[1]/span')
    # ENI modify修改成功之后的新名称
    eni_modify_new_name = (By.XPATH, '//*[@class="next-table-row first"]/td[2]/div/div/div/div/div/div[2]/div/span/span')

    # ENI列表中的Bind to Instance绑定实例按钮
    eni_bind_instance_btn = (By.XPATH, '//*[@class="next-table-row first"]/td[14]/div/div/button[2]/span')
    # ENI列表中的Bind to Instance绑定实例弹框复选框
    eni_bind_instance_box = (By.XPATH, '//*[@class="next-loading-wrap"]/div/form/div[2]/div[2]/div/div/div/span/span[1]/span[1]/span/input')
    # ENI列表中的Bind to Instance绑定实例弹框的实例选项按钮
    eni_bind_instance_data_btn = (By.XPATH, '//*[@class="next-overlay-wrapper opened"]/div/ul/li/div/span')
    # 绑定实例弹框的实例选项弹框OK按钮
    bind_eni_tips_ok_btn = (By.XPATH, '//*[@class="next-dialog-footer next-align-right"]/button[2]/span')
    # 绑定实例弹框的实例选项Cancel按钮
    bind_eni_tips_cancel_btn = (By.XPATH, '//*[@class="next-dialog-footer next-align-right"]/button[1]/span')

    # ENI列表中的...更多按钮
    eni_more_btn = (By.XPATH, '//*[@class="next-table-row first"]/td[14]/div/div/button[3]/i[1]')
    # ENI列表中的delete按钮
    eni_delete_btn = (By.XPATH, '//*[@class="next-overlay-wrapper v2 opened"]/div/ul/div[1]')
    # ENI删除提示框 Are you sure that you want to delete the selected ENI?
    eni_delete_tips_box = (By.XPATH, '//*[@class="next-overlay-wrapper opened"]/div[2]/div/div[1]/div/div[1]')
    # ENI删除提示弹框OK按钮
    eni_delete_tips_ok_btn = (By.XPATH, '//*[@class="next-dialog-footer next-align-right"]/button[2]/span')

    # ENI页面搜索类型下拉按钮
    eni_search_drop_btn = (By.XPATH, '//*[@class="teamix-pro-form-light-filter-main"]/span/span/span[2]/span')
    # ENI页面搜索类型 ENI Name
    eni_search_name_type_btn = (By.XPATH, '//*[@class="next-overlay-wrapper opened"]/div/ul/li[1]/div/span')
    # ENI页面搜索类型 ENI ID
    eni_search_id_type_btn = (By.XPATH, '//*[@class="next-overlay-wrapper opened"]/div/ul/li[2]/div/span')
    # ENI页面搜索类型 Private IP Address
    eni_search_ip_type_btn = (By.XPATH, '//*[@class="next-overlay-wrapper opened"]/div/ul/li[4]/div/span')
    # ENI页面搜索类型 Instance ID
    eni_search_instance_type_btn = (By.XPATH, '//*[@class="next-overlay-wrapper opened"]/div/ul/li[6]/div/span')
    # ENI页面搜索类型 Tag
    eni_search_tag_type_btn = (By.XPATH, '//*[@class="next-overlay-wrapper opened"]/div/ul/li[7]/div/span')
    # ENI页面搜索框
    eni_search_input_btn = (By.XPATH, '//*[@class="teamix-pro-form-query-filter-inline"]/div/form/span/span[1]/div/div/div/div/div/span/input')
    # ENI页面搜索按钮
    eni_search_btn = (By.CSS_SELECTOR, '[class="next-btn next-medium next-btn-normal isOnlyIcon is-hybridcloud"]')
    # ENI页面搜索结果eni名称
    eni_search_data_name = (By.XPATH, '//*[@class="next-table-row first"]/td[2]/div/div/div/div/div/div[2]/div/span/span')

